package de.tabuma.pm.externalproject.controller;

import de.tabuma.lib.tabumacontroller;
import java.io.PrintWriter;
import java.util.*;
import java.util.logging.*;
import de.tabuma.pm.*;
import de.tabuma.pm.externalproject.entity.*;
import de.tabuma.pm.externalproject.logik.*;
import javax.servlet.*;
import javax.servlet.http.*;

/**
 *
 * @author alefen
 */
public class controller extends tabumacontroller {

    private static final Logger log = Logger.getLogger(controller.class.getName());

    public controller(String servlet, Hashtable parameter) {
        super(servlet, parameter);
    }

    @Override
    public void navigate(ServletContext context, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {

        if(request.getParameter(constants.addExternalProject)!=null) {
            create create = new create(this.getServlet(), this.getParameter());
            create.navigate(context, request, response, out);
            return;
        }

        if(request.getParameter(constants.addExternalProject1)!=null) {
            create create = new create(this.getServlet(), this.getParameter());
            create.navigate(context, request, response, out);
            return;
        }

        if(request.getParameter(constants.updateExternalProject)!=null) {
            update update = new update(this.getServlet(), this.getParameter());
            update.navigate(context, request, response, out);
            return;
        }

        if(request.getParameter(constants.updateExternalProject1)!=null) {
            update update = new update(this.getServlet(), this.getParameter());
            update.navigate(context, request, response, out);
            return;
        }

        if(request.getParameter(constants.removeExternalProject)!=null) {
            remove remove = new remove(this.getServlet(), this.getParameter());
            remove.navigate(context, request, response, out);
            return;
        }

        if(request.getParameter(constants.removeExternalProject1)!=null) {
            remove remove = new remove(this.getServlet(), this.getParameter());
            remove.navigate(context, request, response, out);
            return;
        }

        list list = new list(this.getServlet(), this.getParameter());
        list.navigate(context, request, response, out);
    }
}